package cn.matezk.lianlian.dao;

import cn.matezk.lianlian.dto.DeviceDto;
import cn.matezk.lianlian.model.Device;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface DeviceDao {
    int insertSelective(Device device);
    Device selectByPrimaryKey(String deviceId);
    int updateByPrimaryKeySelective(Device device);
    int deleteByPrimaryKey(String deviceId);
    List<Device> selectByProductId(String productId);
    Device selectByDeviceName(String deviceName);
    List<Device> selectProductDeviceByUnionId(@Param("unionId") String unionId, @Param("productId") String productId);
    int todayExFactory();
    int updateAmount(@Param("deviceId") String deviceId, @Param("amount") Integer amount);
    List<String> selectEmptyIccid();
    int updateDeviceStatusPrimaryKey(Device device);
    List<Device> select(DeviceDto deviceDto);
    int batchUpdateCardInfo(List<Device> deviceList);
    List<Device> selectByAppKey(String appKey);
    int updateExpireDate(@Param("deviceId") String deviceId, @Param("expireDate")Date expireDate);
    List<String> expireIccid(@Param("cardSource") String cardSource);
    List<String> renewedIccid(@Param("cardSource") String cardSource);
    int updateIccidState(@Param("iccid") String iccid, @Param("state") Integer state);
}
